\(\int \csc (a+b x) \, dx\) [1]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 6, antiderivative size = 12 \[ \int \csc (a+b x) \, dx=-\frac {\text {arctanh}(\cos (a+b x))}{b} \]

[Out]

-arctanh(cos(b*x+a))/b

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3855} \[ \int \csc (a+b x) \, dx=-\frac {\text {arctanh}(\cos (a+b x))}{b} \]

[In]

Int[Csc[a + b*x],x]

[Out]

-(ArcTanh[Cos[a + b*x]]/b)

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {arctanh}(\cos (a+b x))}{b} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(38\) vs. \(2(12)=24\).

Time = 0.03 (sec) , antiderivative size = 38, normalized size of antiderivative = 3.17 \[ \int \csc (a+b x) \, dx=-\frac {\log \left (\cos \left (\frac {a}{2}+\frac {b x}{2}\right )\right )}{b}+\frac {\log \left (\sin \left (\frac {a}{2}+\frac {b x}{2}\right )\right )}{b} \]

[In]

Integrate[Csc[a + b*x],x]

[Out]

-(Log[Cos[a/2 + (b*x)/2]]/b) + Log[Sin[a/2 + (b*x)/2]]/b

Maple [A] (verified)

Time = 0.14 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.25

method result size
norman \(\frac {\ln \left (\tan \left (\frac {a}{2}+\frac {x b}{2}\right )\right )}{b}\) \(15\)
parallelrisch \(\frac {\ln \left (\tan \left (\frac {a}{2}+\frac {x b}{2}\right )\right )}{b}\) \(15\)
derivativedivides \(-\frac {\ln \left (\csc \left (x b +a \right )+\cot \left (x b +a \right )\right )}{b}\) \(20\)
default \(-\frac {\ln \left (\csc \left (x b +a \right )+\cot \left (x b +a \right )\right )}{b}\) \(20\)
risch \(-\frac {\ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right )}{b}+\frac {\ln \left ({\mathrm e}^{i \left (x b +a \right )}-1\right )}{b}\) \(35\)

[In]

int(csc(b*x+a),x,method=_RETURNVERBOSE)

[Out]

1/b*ln(tan(1/2*a+1/2*x*b))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 30 vs. \(2 (12) = 24\).

Time = 0.25 (sec) , antiderivative size = 30, normalized size of antiderivative = 2.50 \[ \int \csc (a+b x) \, dx=-\frac {\log \left (\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2}\right ) - \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2}\right )}{2 \, b} \]

[In]

integrate(csc(b*x+a),x, algorithm="fricas")

[Out]

-1/2*(log(1/2*cos(b*x + a) + 1/2) - log(-1/2*cos(b*x + a) + 1/2))/b

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 37 vs. \(2 (10) = 20\).

Time = 0.85 (sec) , antiderivative size = 37, normalized size of antiderivative = 3.08 \[ \int \csc (a+b x) \, dx=\begin {cases} - \frac {\log {\left (\cot {\left (a + b x \right )} + \csc {\left (a + b x \right )} \right )}}{b} & \text {for}\: b \neq 0 \\\frac {x \left (\cot {\left (a \right )} \csc {\left (a \right )} + \csc ^{2}{\left (a \right )}\right )}{\cot {\left (a \right )} + \csc {\left (a \right )}} & \text {otherwise} \end {cases} \]

[In]

integrate(csc(b*x+a),x)

[Out]

Piecewise((-log(cot(a + b*x) + csc(a + b*x))/b, Ne(b, 0)), (x*(cot(a)*csc(a) + csc(a)**2)/(cot(a) + csc(a)), T
rue))

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.58 \[ \int \csc (a+b x) \, dx=-\frac {\log \left (\cot \left (b x + a\right ) + \csc \left (b x + a\right )\right )}{b} \]

[In]

integrate(csc(b*x+a),x, algorithm="maxima")

[Out]

-log(cot(b*x + a) + csc(b*x + a))/b

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.25 \[ \int \csc (a+b x) \, dx=\frac {\log \left ({\left | \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, a\right ) \right |}\right )}{b} \]

[In]

integrate(csc(b*x+a),x, algorithm="giac")

[Out]

log(abs(tan(1/2*b*x + 1/2*a)))/b

Mupad [B] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00 \[ \int \csc (a+b x) \, dx=-\frac {\mathrm {atanh}\left (\cos \left (a+b\,x\right )\right )}{b} \]

[In]

int(1/sin(a + b*x),x)

[Out]

-atanh(cos(a + b*x))/b